function reverseString(message){
    var newStr="";
    for(var i = message.length;i>=0; i--){

        var a = message.charAt(i)
            newStr += a;}
    console.log(newStr)
    document.write("'"+newStr+"'")
}
reverseString('hello');// should return 'olleh '

